#ifndef GameMessage_h__
#define GameMessage_h__

#include "Networking.h"
class GameMessage
{
public:

	GameMessage() : m_timeStamp(0.0f){}
	virtual ~GameMessage(){}
    static void StaticPrepareFactory();
	virtual bool Execute() = 0;
	virtual void WriteToSckMsg(Networking::SockMsg* sm) = 0;
	virtual bool ReadFromSckMsg(Networking::SockMsg* sm) = 0;
	virtual const char* GetTypeName() const = 0;

    float GetTimeStamp() const {return m_timeStamp;}
    void SetTimeStamp(float ts){m_timeStamp = ts;}

protected:
    float m_timeStamp;
};

//Handy
struct GameMessageCompare
{
    bool operator() (const GameMessage* lhs, const GameMessage* rhs)
    {
        return lhs->GetTimeStamp() < rhs->GetTimeStamp();
    }
};

#endif // GameMessage_h__
